<template>
  <div>
    <div class="box">
        <h3>数据的发送方</h3>
        <button @click="add">+1</button>
        <div>
            发送方的数据值{{count}}
        </div>
    </div>
  </div>
</template>

<script>
import bus from './eventBus.js'
export default {
    name:'Left',
    data(){
        return{
            count:1
        }
    },
    methods:{
        add(){
            this.count++
            bus.emit('onchange',this.count)
        }
    }

}
</script>

<style lang="less" >
.box{
    border: 1px solid black;
    box-sizing: border-box;
    width: 300px;
    height: 300px;
}

</style>